package cn.com.nes.site.service.maintenanceReminder.impl;
import cn.com.nes.mybatis.agent.maintenanceReminder.mapper.MaintenanceReminderMapper;
import cn.com.nes.site.entity.dto.maintenanceReminder.MaintenanceReminderDto;
import cn.com.nes.site.entity.vo.maintenanceReminder.MaintenanceReminderVo;
import cn.com.nes.site.service.maintenanceReminder.MaintenanceReminderService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;


@Service
public class MaintenanceReminderServiceImpl implements MaintenanceReminderService {
    @Resource
    private MaintenanceReminderMapper maintenanceReminderMapper;

    @Override
    public Integer addMaintenanceReminder(MaintenanceReminderVo vo) {
      return   maintenanceReminderMapper.addMaintenanceReminder(vo);
    }

    @Override
    public Page<MaintenanceReminderDto> queryMaintenanceReminder(MaintenanceReminderVo vo) {
        Page<MaintenanceReminderDto> page = new Page<>(vo.getPageid(), vo.getPagesize());
        return page.setRecords(maintenanceReminderMapper.queryMaintenanceReminder(page,vo));
    }

    @Override
    public Integer deleteMaintenanceReminderById(MaintenanceReminderVo vo) {
        return maintenanceReminderMapper.deleteMaintenanceReminderById(vo);
    }

    @Override
    public Integer updateMaintenanceReminder(MaintenanceReminderVo vo){

        return maintenanceReminderMapper.updateMaintenanceReminder(vo);
    }
}
